@extends('template.adminpage')
@section('content')

<ol class="breadcrumb">
  <li class="active">Brosur</li>
</ol>

<div class="container-black">
  <label style="margin-top:10px"><u>Pencarian</u></label>
  
  <form action="{{URL::to('/brosurs')}}" method="POST">
         <div class="row">
          <div class="col-md-8">
            <div class="col-md-1">
              <input name="filter" value="type" type="radio" <?php if(Session::get('filter')=="type") echo "checked" ?> required ></input>
            </div>
            <div class="col-lg-2">
            <label>Type</label>
            </div>
            <div class="col-lg-4">
               <select  class="form-control" name="typeby" style="height:30px" >
            <?php
            $type = array('all'=>'All','brochure' => 'Brosur', 'envelope' => 'Envelope', 'flayer' => 'Flayer', 'letterhead' => 'Letterhead');
            foreach ($type as $key => $val) {
                if ($key == Session::get('list')) {
                    echo '<option value="' . $key . '" selected>' . $val . '</option>';
                } else {
                    echo '<option value="' . $key . '">' . $val . '</option>';
                }
            }
            ?>
              </select>
            </div>
          </div>
          </div>
          <br>

          <div class="row">
          <div class="col-md-8">
            <div class="col-md-1">
              <input name="filter" value="keyword" type="radio" <?php if(Session::get('filter')=="keyword") echo "checked" ?>></input>
            </div>
            <div class="col-lg-2">
            <label>Nama kertas</label>
            </div>
            <div class="col-lg-4">
              <input type="text"  class="form-control" placeholder="Nama kertas" name="name" style="height:30px" value="{{Session::get('name')}}" ></input>
            </div>
          </div>
          </div>
          <br>
          <div class="row">
          <div class="col-md-8">
            <div class="col-md-4 col-md-offset-3">
                 <button class="btn btn-sm btn-dark" type="submit" style="width:100px;height:30px"><span class="fa fa-search"></span> Tampilkan</button>
            </div>
          </div>
          </div>
        

    </form>
    <br>
    <form action="{{URL::to('/brosur/deletebrosur')}}"  method="post" >
    <p><a data-toggle="modal" data-target="#addbrosur"><button class="btn btn-sm btn-dark" style="height:30px" ><span class="fa fa-plus"></span> Tambah brosur</button></a> <a data-toggle="modal" data-target="#addflayer"><button class="btn btn-sm btn-dark" style="height:30px" ><span class="fa fa-plus"></span> Tambah flayer</button></a> <a data-toggle="modal" data-target="#addkopsurat"><button class="btn btn-sm btn-dark" style="height:30px" ><span class="fa fa-plus"></span> Tambah kop surat</button></a> <a data-toggle="modal" data-target="#addamplop"><button class="btn btn-sm btn-dark" style="height:30px" ><span class="fa fa-plus"></span> Tambah amplop</button></a> <button class="btn btn-sm btn-dark pull-right" type="submit" style="height:30px" ><span class="fa  fa-times"></span> Hapus</button></p>
     <?php
        $limit = 10;
        if(Input::get('page')==0 OR Input::get('page')==1){ 
         $no = 1;
        }
        else{
        $no = ((Input::get('page')-1)*$limit)+1;
        } ?>
     <table class="table table-bordered table-hover">
      <thead>
        <tr>
          <th><input type="checkbox" name="checkall" id="terserah" onclick="check_all('terserah', {{$no}})" ></input></th>
          <th>No</th>
          <th>Nama / Ukuran</th>
          <th>Warna / Halaman</th>
          <th>Kertas </th>
          <th>Harga / Qty (Unit)</th>
          <th>Aksi</th>
        </tr>
      </thead>
      <tbody>
        
        @foreach($brosurs as $brosur)
        <?php
        if($brosur->brochure_type=='brochure'){
          $name = 'Brochure '.$brosur->size_brochure_name;
        }else  if($brosur->brochure_type=='flayer'){
          $name = 'Flayer '.$brosur->size_flayer_length.'x'.$brosur->size_flayer_width;
        }else if($brosur->brochure_type=='letterhead'){
          $name = 'Letterhead '.$brosur->size_brochure_name;
        }else  if($brosur->brochure_type=='envelope'){
          $name = 'Envelope'.$brosur->size_envelope_length.'x'.$brosur->size_envelope_width;
        }
        ?>
        <tr>
          <td><input type="checkbox" name="{{$brosur->brochure_id}}" value="1" id="terserah_{{$no}}" ></input></td>
          <td>{{$no}}</td>
          <td>{{$name}}</td>
          <td>{{$brosur->brochure_color.' / '.$brosur->brochure_qty_print_page}} Muka</td>
          <td>{{$brosur->papertype_name}}</td>
          <td>Rp {{number_format($brosur->brochure_price,0,'.','.').' / '.$brosur->brochure_qty_price.' '.$brosur->brochure_unit}}</td>
          <td><a data-toggle="modal" data-target="<?php if($brosur->brochure_type=='brochure'){echo '#brosur'.$brosur->brochure_id;}else if($brosur->brochure_type=='flayer'){echo '#flayer'.$brosur->brochure_id;}else if($brosur->brochure_type=='letterhead'){echo '#kopsurat'.$brosur->brochure_id;}else if($brosur->brochure_type=='envelope'){echo '#amplop'.$brosur->brochure_id;}else ?>"><button class="btn btn-xs btn-dark"><span class="fa fa-edit"></span> Ubah</button></a></td>
        </tr>
        <?php $no++; ?>
        @endforeach
      </tbody>
    </table>
     <div class="text-right"><?php echo $brosurs->links(); ?></div>
  </form>
   

     <div class="modal fade" id="addbrosur" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel" aria-hidden="false">
                <div class="modal-dialog modal-lg">
                  <div class="modal-content">
                    <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
 
                    <h4 align="center" class="modal-title"> <label style="margin-top:5px; margin-bottom:25px">Brosur - Tambah brosur</label></h4>
                    </div>
                   <div align="left">
                   <br>
                          {{Form::open(array(
                                'url' => '/brosur/addbrosur',
                                'method' => 'POST'
                              ))}}
                          <div class="row">
                          <div class="col-md-8 col-md-offset-1">

                                    <div class="row">
                                  <div class="col-lg-5">
                                  <label>Nama</label>
                                  </div>
                                  <div class="col-lg-4">
                                    <input type="hidden" name="brochure_type"  value="brochure"></input>
                                    <input type="text" class="form-control" name="brochure_type" style="width:200px;height:30px" value="Brochure" disabled></input>
                                  </div>
                                  </div>
                                  <br>

                                  <div class="row">
                                  <div class="col-lg-5">
                                  <label>Ukuran</label>
                                  </div>
                                  <div class="col-lg-4">
                                     <select  class="form-control" name="brochure_size_id" style="width:200px;height:30px" >
                                      <?php
                                        $brosursizes = DB::table('ref_size_brochure')
                                                      ->get();
                                      ?>
                                      @foreach($brosursizes as $brosursize)
                                      <option value="{{$brosursize->size_brochure_size_id}}">{{$brosursize->size_brochure_name}}</option>
                                      @endforeach
                                    </select>
                                  </div>
                                  </div>
                                  <br>

                                  <div class="row">
                                  <div class="col-lg-5">
                                  <label>Warna</label>
                                  </div>
                                  <div class="col-lg-4">
                                   <select  class="form-control" name="brochure_color" style="width:200px;height:30px" >
                                      <option value="Warna">Warna</option>
                                      <option value="Hitam putih">Hitam putih</option>
                                    </select>
                                  </div>
                                  </div>
                                  <br>

                                  <div class="row">
                                  <div class="col-lg-5">
                                  <label>Qty cetak halaman</label>
                                  </div>
                                  <div class="col-lg-4">
                                   <select  class="form-control" name="brochure_qty_print_page" style="width:100px;height:30px" >
                                      <option value="1/2">1/2</option>
                                      <option value="1">1</option>
                                      <option value="1 1/2">1 1/2</option>
                                      <option value="2">2</option>
                                    </select>
                                  </div>
                                  </div>
                                  <br>
                                  
                                  <div class="row">
                                  <div class="col-lg-5">
                                  <label>Kertas</label>
                                  </div>
                                  <div class="col-lg-4">
                                     <select  class="form-control" name="brochure_papertype_id" style="width:200px;height:30px" >
                                      <?php
                                        $papers = DB::table('ref_papertype')
                                                      ->where('papertype_type','=','brochure')
                                                      ->get();
                                      ?>
                                      @foreach($papers as $paper)
                                      <option value="{{$paper->papertype_id}}">{{$paper->papertype_name}}</option>
                                      @endforeach
                                    </select>
                                  </div>
                                  </div>
                                  <br>

                                  <div class="row">
                                  <div class="col-lg-5">
                                  <label>Harga <font color="red"> *</font></label>
                                  </div>
                                  <div class="col-lg-7">
                                    <input type="text"  class="form-control"  name="brochure_price" placeholder="Harga"style="width:200px;height:30px" value="" required /></input>
                                  </div>
                                  </div>
                                  <br>

                                    <div class="row">
                                    <div class="col-lg-5">
                                      <label>Qty / Unit <font color="red"> *</font></label>
                                    </div>
                                    <div class="col-lg-3">
                                     <input type="text"  class="form-control"  name="brochure_qty_price" placeholder="1000" style="width:90px;height:30px" value="" required/></input>
                                    </div>
                                    <div class="col-lg-1">
                                     /
                                    </div>
                                    
                                    <div class="col-lg-3">
                                      <select  class="form-control"  name="brochure_unit" style="width:80px;height:30px">
                                        <option value="Pcs">Pcs</option>
                                        <option value="Rim">Rim</option>
                                      </select>
                                    </div>
                                    </div>
                                    <br>
                                      <font color="red" class="text-left">* Data tidak boleh kosong</font>
                          </div>
                          </div>
                       </div>
                    <div class="modal-footer">
                    <button type="submit" class="btn btn-sm btn-dark"><span class="fa fa-floppy-o"></span> Simpan</button>{{Form::close()}} <button class="btn btn-sm btn-dark" style="margin-right:5px" class="close" data-dismiss="modal"><span class="fa fa-times"></span> Batal</button></a>
                    </div>
                  </div>
                </div>
              </div>

 <div class="modal fade" id="addflayer" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel" aria-hidden="false">
                <div class="modal-dialog modal-lg">
                  <div class="modal-content">
                    <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
 
                    <h4 align="center" class="modal-title"> <label style="margin-top:5px; margin-bottom:25px">Brosur - Tambah flayer</label></h4>
                    </div>
                   <div align="left">
                   <br>
                          {{Form::open(array(
                                'url' => '/brosur/addflayer',
                                'method' => 'POST'
                              ))}}
                         <div class="row">
                          <div class="col-md-8 col-md-offset-1">

                                    <div class="row">
                                  <div class="col-lg-5">
                                  <label>Nama</label>
                                  </div>
                                  <div class="col-lg-4">
                                    <input type="hidden" name="brochure_type"  value="flayer"></input>
                                    <input type="text" class="form-control" name="brosur_type" style="width:200px;height:30px" value="Flayer" disabled></input>
                                  </div>
                                  </div>
                                  <br>

                                  <div class="row">
                                  <div class="col-lg-5">
                                  <label>Ukuran</label>
                                  </div>
                                  <div class="col-lg-7">
                                    <div class="row">
                                    <div class="col-md-4">
                                    <input type="text" class="form-control" name="size_flayer_length" style="width:60px;height:30px" required></input>
                                    </div>
                                    <div class="col-md-1">
                                      x
                                    </div>
                                    <div class="col-md-4">
                                    <input type="text" class="form-control" name="size_flayer_width" style="width:60px;height:30px" required></input>
                                    </div>
                                    <div class="col-md-1">
                                      Cm
                                    </div>
                                    </div>
                                  </div>
                                  </div>
                                  <br>

                                 <div class="row">
                                  <div class="col-lg-5">
                                  <label>Warna</label>
                                  </div>
                                  <div class="col-lg-4">
                                   <select  class="form-control" name="brochure_color" style="width:200px;height:30px" >
                                      <option value="Warna">Warna</option>
                                      <option value="Hitam putih">Hitam putih</option>
                                    </select>
                                  </div>
                                  </div>
                                  <br>

                                  <div class="row">
                                  <div class="col-lg-5">
                                  <label>Qty cetak halaman</label>
                                  </div>
                                  <div class="col-lg-4">
                                   <select  class="form-control" name="brochure_qty_print_page" style="width:100px;height:30px" >
                                      <option value="1/2">1/2</option>
                                      <option value="1">1</option>
                                      <option value="1 1/2">1 1/2</option>
                                      <option value="2">2</option>
                                    </select>
                                  </div>
                                  </div>
                                  <br>
                                  
                                  <div class="row">
                                  <div class="col-lg-5">
                                  <label>Kertas</label>
                                  </div>
                                  <div class="col-lg-4">
                                     <select  class="form-control" name="brochure_papertype_id" style="width:200px;height:30px" >
                                      <?php
                                        $papers = DB::table('ref_papertype')
                                                      ->where('papertype_type','=','brochure')
                                                      ->get();
                                      ?>
                                      @foreach($papers as $paper)
                                      <option value="{{$paper->papertype_id}}">{{$paper->papertype_name}}</option>
                                      @endforeach
                                    </select>
                                  </div>
                                  </div>
                                  <br>

                                  <div class="row">
                                  <div class="col-lg-5">
                                  <label>Harga <font color="red"> *</font></label>
                                  </div>
                                  <div class="col-lg-7">
                                    <input type="text"  class="form-control"  name="brochure_price" placeholder="Harga"style="width:200px;height:30px" value="" required /></input>
                                  </div>
                                  </div>
                                  <br>

                                    <div class="row">
                                    <div class="col-lg-5">
                                      <label>Qty / Unit <font color="red"> *</font></label>
                                    </div>
                                    <div class="col-lg-3">
                                     <input type="text"  class="form-control"  name="brochure_qty_price" placeholder="1000" style="width:90px;height:30px" value="" required/></input>
                                    </div>
                                    <div class="col-lg-1">
                                     /
                                    </div>
                                    
                                    <div class="col-lg-3">
                                      <select  class="form-control"  name="brochure_unit" style="width:80px;height:30px">
                                        <option value="Pcs">Pcs</option>
                                        <option value="Rim">Rim</option>
                                      </select>
                                    </div>
                                    </div>
                                    <br>
                                      <font color="red" class="text-left">* Data tidak boleh kosong</font>
                          </div>
                          </div>
                       </div>
                    <div class="modal-footer">
                    <button type="submit" class="btn btn-sm btn-dark"><span class="fa fa-floppy-o"></span> Simpan</button>{{Form::close()}} <button class="btn btn-sm btn-dark" style="margin-right:5px" class="close" data-dismiss="modal"><span class="fa fa-times"></span> Batal</button></a>
                    </div>
                  </div>
                </div>
              </div>

 <div class="modal fade" id="addkopsurat" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel" aria-hidden="false">
                <div class="modal-dialog modal-lg">
                  <div class="modal-content">
                    <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
 
                    <h4 align="center" class="modal-title"> <label style="margin-top:5px; margin-bottom:25px">Brosur - Tambah kop surat</label></h4>
                    </div>
                   <div align="left">
                   <br>
                          {{Form::open(array(
                                'url' => '/brosur/addkopsurat',
                                'method' => 'POST'
                              ))}}
                       <div class="row">
                          <div class="col-md-8 col-md-offset-1">

                                    <div class="row">
                                  <div class="col-lg-5">
                                  <label>Nama</label>
                                  </div>
                                  <div class="col-lg-4">
                                    <input type="hidden" name="brochure_type"  value="letterhead"></input>
                                    <input type="text" class="form-control" name="brochure_type" style="width:200px;height:30px" value="Letterhead" disabled></input>
                                  </div>
                                  </div>
                                  <br>

                                  <div class="row">
                                  <div class="col-lg-5">
                                  <label>Ukuran</label>
                                  </div>
                                  <div class="col-lg-4">
                                     <select  class="form-control" name="brochure_size_id" style="width:200px;height:30px" >
                                      <?php
                                        $brosursizes = DB::table('ref_size_letterhead')
                                                      ->get();
                                      ?>
                                      @foreach($brosursizes as $brosursize)
                                      <option value="{{$brosursize->size_letterhead_size_id}}">{{$brosursize->size_letterhead_name}}</option>
                                      @endforeach
                                    </select>
                                  </div>
                                  </div>
                                  <br>

                                  <div class="row">
                                  <div class="col-lg-5">
                                  <label>Warna</label>
                                  </div>
                                  <div class="col-lg-4">
                                   <select  class="form-control" name="brochure_color" style="width:200px;height:30px" >
                                      <option value="Warna">Warna</option>
                                      <option value="Hitam putih">Hitam putih</option>
                                    </select>
                                  </div>
                                  </div>
                                  <br>

                                  <div class="row">
                                  <div class="col-lg-5">
                                  <label>Qty cetak halaman</label>
                                  </div>
                                  <div class="col-lg-4">
                                   <select  class="form-control" name="brochure_qty_print_page" style="width:100px;height:30px" >
                                      <option value="1/2">1/2</option>
                                      <option value="1">1</option>
                                      <option value="1 1/2">1 1/2</option>
                                      <option value="2">2</option>
                                    </select>
                                  </div>
                                  </div>
                                  <br>
                                  
                                  <div class="row">
                                  <div class="col-lg-5">
                                  <label>Kertas</label>
                                  </div>
                                  <div class="col-lg-4">
                                     <select  class="form-control" name="brochure_papertype_id" style="width:200px;height:30px" >
                                      <?php
                                        $papers = DB::table('ref_papertype')
                                                      ->where('papertype_type','=','letterhead')
                                                      ->get();
                                      ?>
                                      @foreach($papers as $paper)
                                      <option value="{{$paper->papertype_id}}">{{$paper->papertype_name}}</option>
                                      @endforeach
                                    </select>
                                  </div>
                                  </div>
                                  <br>

                                  <div class="row">
                                  <div class="col-lg-5">
                                  <label>Harga <font color="red"> *</font></label>
                                  </div>
                                  <div class="col-lg-7">
                                    <input type="text"  class="form-control"  name="brochure_price" placeholder="Harga"style="width:200px;height:30px" value="" required /></input>
                                  </div>
                                  </div>
                                  <br>

                                    <div class="row">
                                    <div class="col-lg-5">
                                      <label>Qty / Unit <font color="red"> *</font></label>
                                    </div>
                                    <div class="col-lg-3">
                                     <input type="text"  class="form-control"  name="brochure_qty_price" placeholder="1000" style="width:90px;height:30px" value="" required/></input>
                                    </div>
                                    <div class="col-lg-1">
                                     /
                                    </div>
                                    
                                    <div class="col-lg-3">
                                      <select  class="form-control"  name="brochure_unit" style="width:80px;height:30px">
                                        <option value="Pcs">Pcs</option>
                                        <option value="Rim">Rim</option>
                                      </select>
                                    </div>
                                    </div>
                                    <br>
                                      <font color="red" class="text-left">* Data tidak boleh kosong</font>
                          </div>
                          </div>
                       </div>
                    <div class="modal-footer">
                    <button type="submit" class="btn btn-sm btn-dark"><span class="fa fa-floppy-o"></span> Simpan</button>{{Form::close()}} <button class="btn btn-sm btn-dark" style="margin-right:5px" class="close" data-dismiss="modal"><span class="fa fa-times"></span> Batal</button></a>
                    </div>
                  </div>
                </div>
              </div>

 <div class="modal fade" id="addamplop" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel" aria-hidden="false">
                <div class="modal-dialog modal-lg">
                  <div class="modal-content">
                    <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
 
                    <h4 align="center" class="modal-title"> <label style="margin-top:5px; margin-bottom:25px">Brosur - Tambah amplop</label></h4>
                    </div>
                   <div align="left">
                   <br>
                          {{Form::open(array(
                                'url' => '/brosur/addenvelope',
                                'method' => 'POST'
                              ))}}
                             <div class="row">
                          <div class="col-md-8 col-md-offset-1">

                                    <div class="row">
                                  <div class="col-lg-5">
                                  <label>Nama</label>
                                  </div>
                                  <div class="col-lg-4">
                                    <input type="hidden" name="brochure_type"  value="envelope"></input>
                                    <input type="text" class="form-control" name="brosur_type" style="width:200px;height:30px" value="Envelope" disabled></input>
                                  </div>
                                  </div>
                                  <br>

                                  <div class="row">
                                  <div class="col-lg-5">
                                  <label>Ukuran</label>
                                  </div>
                                  <div class="col-lg-7">
                                    <div class="row">
                                    <div class="col-md-4">
                                    <input type="text" class="form-control" name="size_envelope_length" style="width:60px;height:30px" required></input>
                                    </div>
                                    <div class="col-md-1">
                                      x
                                    </div>
                                    <div class="col-md-4">
                                    <input type="text" class="form-control" name="size_envelope_width" style="width:60px;height:30px" required></input>
                                    </div>
                                    <div class="col-md-1">
                                      Cm
                                    </div>
                                    </div>
                                  </div>
                                  </div>
                                  <br>

                                <div class="row">
                                  <div class="col-lg-5">
                                  <label>Warna</label>
                                  </div>
                                  <div class="col-lg-4">
                                   <select  class="form-control" name="brochure_color" style="width:200px;height:30px" >
                                      <option value="Warna">Warna</option>
                                      <option value="Hitam putih">Hitam putih</option>
                                    </select>
                                  </div>
                                  </div>
                                  <br>

                                  <div class="row">
                                  <div class="col-lg-5">
                                  <label>Qty cetak halaman</label>
                                  </div>
                                  <div class="col-lg-4">
                                   <select  class="form-control" name="brochure_qty_print_page" style="width:100px;height:30px" >
                                      <option value="1/2">1/2</option>
                                      <option value="1">1</option>
                                      <option value="1 1/2">1 1/2</option>
                                      <option value="2">2</option>
                                    </select>
                                  </div>
                                  </div>
                                  <br>
                                  
                                  <div class="row">
                                  <div class="col-lg-5">
                                  <label>Kertas</label>
                                  </div>
                                  <div class="col-lg-4">
                                     <select  class="form-control" name="brochure_papertype_id" style="width:200px;height:30px" >
                                      <?php
                                        $papers = DB::table('ref_papertype')
                                                      ->where('papertype_type','=','brochure')
                                                      ->get();
                                      ?>
                                      @foreach($papers as $paper)
                                      <option value="{{$paper->papertype_id}}">{{$paper->papertype_name}}</option>
                                      @endforeach
                                    </select>
                                  </div>
                                  </div>
                                  <br>

                                  <div class="row">
                                  <div class="col-lg-5">
                                  <label>Harga <font color="red"> *</font></label>
                                  </div>
                                  <div class="col-lg-7">
                                    <input type="text"  class="form-control"  name="brochure_price" placeholder="Harga"style="width:200px;height:30px" value="" required /></input>
                                  </div>
                                  </div>
                                  <br>

                                    <div class="row">
                                    <div class="col-lg-5">
                                      <label>Qty / Unit <font color="red"> *</font></label>
                                    </div>
                                    <div class="col-lg-3">
                                     <input type="text"  class="form-control"  name="brochure_qty_price" placeholder="1000" style="width:90px;height:30px" value="" required/></input>
                                    </div>
                                    <div class="col-lg-1">
                                     /
                                    </div>
                                    
                                    <div class="col-lg-3">
                                      <select  class="form-control"  name="brochure_unit" style="width:80px;height:30px">
                                        <option value="Pcs">Pcs</option>
                                        <option value="Rim">Rim</option>
                                      </select>
                                    </div>
                                    </div>
                                    <br>
                                      <font color="red" class="text-left">* Data tidak boleh kosong</font>
                          </div>
                          </div>
                       </div>
                    <div class="modal-footer">
                    <button type="submit" class="btn btn-sm btn-dark"><span class="fa fa-floppy-o"></span> Simpan</button>{{Form::close()}} <button class="btn btn-sm btn-dark" style="margin-right:5px" class="close" data-dismiss="modal"><span class="fa fa-times"></span> Batal</button></a>
                    </div>
                  </div>
                </div>
              </div>

              @foreach($brosurs as $brosur)
              <div class="modal fade" id="brosur{{$brosur->brochure_id}}" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel" aria-hidden="false">
                <div class="modal-dialog modal-lg">
                  <div class="modal-content">
                    <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
 
                    <h4 align="center" class="modal-title"> <label style="margin-top:5px; margin-bottom:25px">Ubah data brosur </label></h4>
                    </div>
                    <div align="left">
                    <br>
                              {{Form::open(array(
                                    'url' => '/brosur/editbrosur/'.$brosur->brochure_id,
                                    'method' => 'POST'
                                  ))}}
                        <div class="row">
                          <div class="col-md-8 col-md-offset-1">

                                    <div class="row">
                                  <div class="col-lg-5">
                                  <label>Nama</label>
                                  </div>
                                  <div class="col-lg-4">
                                    <input type="hidden" name="brochure_type" value="{{$brosur->brochure_type}}"></input>
                                    <input type="text" class="form-control" style="width:200px;height:30px" value="Brochure" disabled></input>
                                  </div>
                                  </div>
                                  <br>

                                  <div class="row">
                                  <div class="col-lg-5">
                                  <label>Ukuran</label>
                                  </div>
                                  <div class="col-lg-4">
                                     <select  class="form-control" name="brochure_size_id" style="width:200px;height:30px" >
                                      <?php
                                        $brosursizes = DB::table('ref_size_brochure')
                                                      ->get();
                                      foreach($brosursizes as $brosursize){
                                        if($brosur->brochure_size_id==$brosursize->size_brochure_size_id){
                                      echo '<option value="'.$brosursize->size_brochure_size_id.'" selected>'.$brosursize->size_brochure_name.'</option>';
                                      }else{
                                      echo '<option value="'.$brosursize->size_brochure_size_id.'">'.$brosursize->size_brochure_name.'</option>';

                                      }
                                      }
                                      ?>
                                    </select>
                                  </div>
                                  </div>
                                  <br>

                                  <div class="row">
                                  <div class="col-lg-5">
                                  <label>Warna</label>
                                  </div>
                                  <div class="col-lg-4">
                                   <select  class="form-control" name="brochure_color" style="width:200px;height:30px" >
                                       <?php
                                        $brosursizes = array('Warna','Hitam putih');
                                      foreach($brosursizes as $key){
                                        if($brosur->brochure_color==$key){
                                      echo '<option value="'.$key.'" selected>'.$key.'</option>';
                                      }else{
                                      echo '<option value="'.$key.'">'.$key.'</option>';

                                      }
                                      }
                                      ?>
                                    </select>
                                  </div>
                                  </div>
                                  <br>

                                  <div class="row">
                                  <div class="col-lg-5">
                                  <label>Qty cetak halaman</label>
                                  </div>
                                  <div class="col-lg-4">
                                   <select  class="form-control" name="brochure_qty_print_page" style="width:100px;height:30px" >
                                       <?php
                                        $brosursizes = array('1/2','1','1 1/2','2');
                                      foreach($brosursizes as $key){
                                        if($brosur->brochure_qty_print_page==$key){
                                      echo '<option value="'.$key.'" selected>'.$key.'</option>';
                                      }else{
                                      echo '<option value="'.$key.'">'.$key.'</option>';

                                      }
                                      }
                                      ?>
                                    </select>
                                  </div>
                                  </div>
                                  <br>
                                  
                                  <div class="row">
                                  <div class="col-lg-5">
                                  <label>Kertas</label>
                                  </div>
                                  <div class="col-lg-4">
                                     <select  class="form-control" name="brochure_papertype_id" style="width:200px;height:30px" >
                                      <?php
                                        $papers = DB::table('ref_papertype')
                                                      ->where('papertype_type','=','brochure')
                                                      ->get();
                                      foreach($papers as $paper){
                                       if($brosur->brochure_papertype_id==$paper->papertype_id){
                                      echo '<option value="'.$paper->papertype_id.'" selected>'.$paper->papertype_name.'</option>';
                                      }else{
                                      echo '<option value="'.$paper->papertype_id.'">'.$paper->papertype_name.'</option>';

                                      }
                                      }
                                     ?>
                                    </select>
                                  </div>
                                  </div>
                                  <br>

                                  <div class="row">
                                  <div class="col-lg-5">
                                  <label>Harga <font color="red"> *</font></label>
                                  </div>
                                  <div class="col-lg-7">
                                    <input type="text"  class="form-control"  name="brochure_price" value="{{$brosur->brochure_price}}" placeholder="Harga"style="width:200px;height:30px" value="" required /></input>
                                  </div>
                                  </div>
                                  <br>

                                    <div class="row">
                                    <div class="col-lg-5">
                                      <label>Qty / Unit <font color="red"> *</font></label>
                                    </div>
                                    <div class="col-lg-3">
                                     <input type="text"  class="form-control"  name="brochure_qty_price"  value="{{$brosur->brochure_qty_price}}" placeholder="1000" style="width:90px;height:30px" value="" required/></input>
                                    </div>
                                    <div class="col-lg-1">
                                     /
                                    </div>
                                    
                                    <div class="col-lg-3">
                                      <select  class="form-control"  name="brochure_unit" style="width:80px;height:30px">
                                        <?php
                                        $brosursizes = array('Pcs','Rim');
                                      foreach($brosursizes as $key){
                                        if($brosur->brochure_unit==$key){
                                      echo '<option value="'.$key.'" selected>'.$key.'</option>';
                                      }else{
                                      echo '<option value="'.$key.'">'.$key.'</option>';

                                      }
                                      }
                                      ?>
                                      </select>
                                    </div>
                                    </div>
                                    <br>
                                      <font color="red" class="text-left">* Data tidak boleh kosong</font>
                          </div>
                          </div>
                    
                    </div>
                    <div class="modal-footer">

                    <button type="submit" class="btn btn-sm btn-dark"><span class="fa fa-floppy-o"></span> Simpan</button>{{Form::close()}} <button class="btn btn-sm btn-dark" style="margin-right:5px" class="close" data-dismiss="modal"><span class="fa fa-times"></span> Batal</button></a>
                         
                    </div>
                  </div>
                </div>
              </div>

               <div class="modal fade" id="flayer{{$brosur->brochure_id}}" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel" aria-hidden="false">
                <div class="modal-dialog modal-lg">
                  <div class="modal-content">
                    <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
 
                    <h4 align="center" class="modal-title"> <label style="margin-top:5px; margin-bottom:25px">Ubah data flayer</label></h4>
                    </div>
                   <div align="left">
                   <br>
                          {{Form::open(array(
                                'url' => '/brosur/editflayer/'.$brosur->brochure_id,
                                'method' => 'POST'
                              ))}}
                        <div class="row">
                          <div class="col-md-8 col-md-offset-1">

                                    <div class="row">
                                  <div class="col-lg-5">
                                  <label>Nama</label>
                                  </div>
                                  <div class="col-lg-4">
                                    <input type="hidden" name="brochure_type" value="{{$brosur->brochure_type}}"></input>
                                    <input type="text" class="form-control"  style="width:200px;height:30px" value="Flayer" disabled></input>
                                  </div>
                                  </div>
                                  <br>

                                  <div class="row">
                                  <div class="col-lg-5">
                                  <label>Ukuran</label>
                                  </div>
                                  <div class="col-lg-7">
                                    <div class="row">
                                    <div class="col-md-4">
                                    <input type="text" class="form-control" name="size_flayer_length" value="{{$brosur->size_flayer_length}}" style="width:60px;height:30px" required></input>
                                    </div>
                                    <div class="col-md-1">
                                      x
                                    </div>
                                    <div class="col-md-4">
                                    <input type="text" class="form-control" name="size_flayer_width" value="{{$brosur->size_flayer_width}}" style="width:60px;height:30px" required></input>
                                    </div>
                                    <div class="col-md-1">
                                      Cm
                                    </div>
                                    </div>
                                  </div>
                                  </div>
                                  <br>

                                 <div class="row">
                                  <div class="col-lg-5">
                                  <label>Warna</label>
                                  </div>
                                  <div class="col-lg-4">
                                   <select  class="form-control" name="brochure_color" style="width:200px;height:30px" >
                                       <?php
                                        $brosursizes = array('Warna','Hitam putih');
                                      foreach($brosursizes as $key){
                                        if($brosur->brochure_color==$key){
                                      echo '<option value="'.$key.'" selected>'.$key.'</option>';
                                      }else{
                                      echo '<option value="'.$key.'">'.$key.'</option>';

                                      }
                                      }
                                      ?>
                                    </select>
                                  </div>
                                  </div>
                                  <br>

                                  <div class="row">
                                  <div class="col-lg-5">
                                  <label>Qty cetak halaman</label>
                                  </div>
                                  <div class="col-lg-4">
                                   <select  class="form-control" name="brochure_qty_print_page" style="width:100px;height:30px" >
                                       <?php
                                        $brosursizes = array('1/2','1','1 1/2','2');
                                      foreach($brosursizes as $key){
                                        if($brosur->brochure_qty_print_page==$key){
                                      echo '<option value="'.$key.'" selected>'.$key.'</option>';
                                      }else{
                                      echo '<option value="'.$key.'">'.$key.'</option>';

                                      }
                                      }
                                      ?>
                                    </select>
                                  </div>
                                  </div>
                                  <br>
                                  
                                  <div class="row">
                                  <div class="col-lg-5">
                                  <label>Kertas</label>
                                  </div>
                                  <div class="col-lg-4">
                                     <select  class="form-control" name="brochure_papertype_id" style="width:200px;height:30px" >
                                      <?php
                                        $papers = DB::table('ref_papertype')
                                                      ->where('papertype_type','=','flayer')
                                                      ->get();
                                      foreach($papers as $paper){
                                       if($brosur->brochure_papertype_id==$paper->papertype_id){
                                      echo '<option value="'.$paper->papertype_id.'" selected>'.$paper->papertype_name.'</option>';
                                      }else{
                                      echo '<option value="'.$paper->papertype_id.'">'.$paper->papertype_name.'</option>';

                                      }
                                      }
                                     ?>
                                    </select>
                                  </div>
                                  </div>
                                  <br>

                                  <div class="row">
                                  <div class="col-lg-5">
                                  <label>Harga <font color="red"> *</font></label>
                                  </div>
                                  <div class="col-lg-7">
                                    <input type="text"  class="form-control"  name="brochure_price" value="{{$brosur->brochure_price}}" placeholder="Harga"style="width:200px;height:30px" value="" required /></input>
                                  </div>
                                  </div>
                                  <br>

                                    <div class="row">
                                    <div class="col-lg-5">
                                      <label>Qty / Unit <font color="red"> *</font></label>
                                    </div>
                                    <div class="col-lg-3">
                                     <input type="text"  class="form-control"  name="brochure_qty_price"  value="{{$brosur->brochure_qty_price}}" placeholder="1000" style="width:90px;height:30px" value="" required/></input>
                                    </div>
                                    <div class="col-lg-1">
                                     /
                                    </div>
                                    
                                    <div class="col-lg-3">
                                      <select  class="form-control"  name="brochure_unit" style="width:80px;height:30px">
                                        <?php
                                        $brosursizes = array('Pcs','Rim');
                                      foreach($brosursizes as $key){
                                        if($brosur->brochure_unit==$key){
                                      echo '<option value="'.$key.'" selected>'.$key.'</option>';
                                      }else{
                                      echo '<option value="'.$key.'">'.$key.'</option>';

                                      }
                                      }
                                      ?>
                                      </select>
                                    </div>
                                    </div>
                                    <br>
                                      <font color="red" class="text-left">* Data tidak boleh kosong</font>
                          </div>
                          </div>
                       </div>
                    <div class="modal-footer">
                    <button type="submit" class="btn btn-sm btn-dark"><span class="fa fa-floppy-o"></span> Simpan</button>{{Form::close()}} <button class="btn btn-sm btn-dark" style="margin-right:5px" class="close" data-dismiss="modal"><span class="fa fa-times"></span> Batal</button></a>
                    </div>
                  </div>
                </div>
              </div>

 <div class="modal fade" id="kopsurat{{$brosur->brochure_id}}" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel" aria-hidden="false">
                <div class="modal-dialog modal-lg">
                  <div class="modal-content">
                    <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
 
                    <h4 align="center" class="modal-title"> <label style="margin-top:5px; margin-bottom:25px">Ubah data kop surat</label></h4>
                    </div>
                   <div align="left">
                   <br>
                          {{Form::open(array(
                                'url' => '/brosur/editletterhead/'.$brosur->brochure_id,
                                'method' => 'POST'
                              ))}}
                         <div class="row">
                          <div class="col-md-8 col-md-offset-1">

                                    <div class="row">
                                  <div class="col-lg-5">
                                  <label>Nama</label>
                                  </div>
                                  <div class="col-lg-4">
                                    <input type="hidden" name="brochure_type"  value="{{$brosur->brochure_type}}"></input>
                                    <input type="text" class="form-control" style="width:200px;height:30px" value="Brochure" disabled></input>
                                  </div>
                                  </div>
                                  <br>

                                  <div class="row">
                                  <div class="col-lg-5">
                                  <label>Ukuran</label>
                                  </div>
                                  <div class="col-lg-4">
                                     <select  class="form-control" name="brochure_size_id" style="width:200px;height:30px" >
                                      <?php
                                        $brosursizes = DB::table('ref_size_letterhead')
                                                      ->get();
                                      foreach($brosursizes as $brosursize){
                                        if($brosur->brochure_size_id==$brosursize->size_letterhead_size_id){
                                      echo '<option value="'.$brosursize->size_letterhead_size_id.'" selected>'.$brosursize->size_letterhead_name.'</option>';
                                      }else{
                                      echo '<option value="'.$brosursize->size_letterhead_size_id.'">'.$brosursize->size_letterhead_name.'</option>';

                                      }
                                      }
                                      ?>
                                    </select>
                                  </div>
                                  </div>
                                  <br>

                                  <div class="row">
                                  <div class="col-lg-5">
                                  <label>Warna</label>
                                  </div>
                                  <div class="col-lg-4">
                                   <select  class="form-control" name="brochure_color" style="width:200px;height:30px" >
                                       <?php
                                        $brosursizes = array('Warna','Hitam putih');
                                      foreach($brosursizes as $key){
                                        if($brosur->brochure_color==$key){
                                      echo '<option value="'.$key.'" selected>'.$key.'</option>';
                                      }else{
                                      echo '<option value="'.$key.'">'.$key.'</option>';

                                      }
                                      }
                                      ?>
                                    </select>
                                  </div>
                                  </div>
                                  <br>

                                  <div class="row">
                                  <div class="col-lg-5">
                                  <label>Qty cetak halaman</label>
                                  </div>
                                  <div class="col-lg-4">
                                   <select  class="form-control" name="brochure_qty_print_page" style="width:100px;height:30px" >
                                       <?php
                                        $brosursizes = array('1/2','1','1 1/2','2');
                                      foreach($brosursizes as $key){
                                        if($brosur->brochure_qty_print_page==$key){
                                      echo '<option value="'.$key.'" selected>'.$key.'</option>';
                                      }else{
                                      echo '<option value="'.$key.'">'.$key.'</option>';

                                      }
                                      }
                                      ?>
                                    </select>
                                  </div>
                                  </div>
                                  <br>
                                  
                                  <div class="row">
                                  <div class="col-lg-5">
                                  <label>Kertas</label>
                                  </div>
                                  <div class="col-lg-4">
                                     <select  class="form-control" name="brochure_papertype_id" style="width:200px;height:30px" >
                                      <?php
                                        $papers = DB::table('ref_papertype')
                                                      ->where('papertype_type','=','letterhead')
                                                      ->get();
                                      foreach($papers as $paper){
                                       if($brosur->brochure_papertype_id==$paper->papertype_id){
                                      echo '<option value="'.$paper->papertype_id.'" selected>'.$paper->papertype_name.'</option>';
                                      }else{
                                      echo '<option value="'.$paper->papertype_id.'">'.$paper->papertype_name.'</option>';

                                      }
                                      }
                                     ?>
                                    </select>
                                  </div>
                                  </div>
                                  <br>

                                  <div class="row">
                                  <div class="col-lg-5">
                                  <label>Harga <font color="red"> *</font></label>
                                  </div>
                                  <div class="col-lg-7">
                                    <input type="text"  class="form-control"  name="brochure_price" value="{{$brosur->brochure_price}}" placeholder="Harga"style="width:200px;height:30px" value="" required /></input>
                                  </div>
                                  </div>
                                  <br>

                                    <div class="row">
                                    <div class="col-lg-5">
                                      <label>Qty / Unit <font color="red"> *</font></label>
                                    </div>
                                    <div class="col-lg-3">
                                     <input type="text"  class="form-control"  name="brochure_qty_price"  value="{{$brosur->brochure_qty_price}}" placeholder="1000" style="width:90px;height:30px" value="" required/></input>
                                    </div>
                                    <div class="col-lg-1">
                                     /
                                    </div>
                                    
                                    <div class="col-lg-3">
                                      <select  class="form-control"  name="brochure_unit" style="width:80px;height:30px">
                                        <?php
                                        $brosursizes = array('Pcs','Rim');
                                      foreach($brosursizes as $key){
                                        if($brosur->brochure_unit==$key){
                                      echo '<option value="'.$key.'" selected>'.$key.'</option>';
                                      }else{
                                      echo '<option value="'.$key.'">'.$key.'</option>';

                                      }
                                      }
                                      ?>
                                      </select>
                                    </div>
                                    </div>
                                    <br>
                                      <font color="red" class="text-left">* Data tidak boleh kosong</font>
                          </div>
                          </div>
                       </div>
                    <div class="modal-footer">
                    <button type="submit" class="btn btn-sm btn-dark"><span class="fa fa-floppy-o"></span> Simpan</button>{{Form::close()}} <button class="btn btn-sm btn-dark" style="margin-right:5px" class="close" data-dismiss="modal"><span class="fa fa-times"></span> Batal</button></a>
                    </div>
                  </div>
                </div>
              </div>

 <div class="modal fade" id="amplop{{$brosur->brochure_id}}" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel" aria-hidden="false">
                <div class="modal-dialog modal-lg">
                  <div class="modal-content">
                    <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
 
                    <h4 align="center" class="modal-title"> <label style="margin-top:5px; margin-bottom:25px">Ubah data amplop</label></h4>
                    </div>
                   <div align="left">
                   <br>
                          {{Form::open(array(
                                'url' => '/brosur/editenvelope/'.$brosur->brochure_id,
                                'method' => 'POST'
                              ))}}
                          <div class="row">
                          <div class="col-md-8 col-md-offset-1">

                                    <div class="row">
                                  <div class="col-lg-5">
                                  <label>Nama</label>
                                  </div>
                                  <div class="col-lg-4">
                                    <input type="hidden" name="brochure_type"  value="{{$brosur->brochure_type}}"></input>
                                    <input type="text" class="form-control" style="width:200px;height:30px" value="Envelope" disabled></input>
                                  </div>
                                  </div>
                                  <br>

                                  <div class="row">
                                  <div class="col-lg-5">
                                  <label>Ukuran</label>
                                  </div>
                                  <div class="col-lg-7">
                                    <div class="row">
                                    <div class="col-md-4">
                                    <input type="text" class="form-control" name="size_envelope_length" value="{{$brosur->size_envelope_length}}" style="width:60px;height:30px" required></input>
                                    </div>
                                    <div class="col-md-1">
                                      x
                                    </div>
                                    <div class="col-md-4">
                                    <input type="text" class="form-control" name="size_envelope_width" value="{{$brosur->size_envelope_width}}" style="width:60px;height:30px" required></input>
                                    </div>
                                    <div class="col-md-1">
                                      Cm
                                    </div>
                                    </div>
                                  </div>
                                  </div>
                                  <br>

                                <div class="row">
                                  <div class="col-lg-5">
                                  <label>Warna</label>
                                  </div>
                                  <div class="col-lg-4">
                                   <select  class="form-control" name="brochure_color" style="width:200px;height:30px" >
                                       <?php
                                        $brosursizes = array('Warna','Hitam putih');
                                      foreach($brosursizes as $key){
                                        if($brosur->brochure_color==$key){
                                      echo '<option value="'.$key.'" selected>'.$key.'</option>';
                                      }else{
                                      echo '<option value="'.$key.'">'.$key.'</option>';

                                      }
                                      }
                                      ?>
                                    </select>
                                  </div>
                                  </div>
                                  <br>

                                  <div class="row">
                                  <div class="col-lg-5">
                                  <label>Qty cetak halaman</label>
                                  </div>
                                  <div class="col-lg-4">
                                   <select  class="form-control" name="brochure_qty_print_page" style="width:100px;height:30px" >
                                       <?php
                                        $brosursizes = array('1/2','1','1 1/2','2');
                                      foreach($brosursizes as $key){
                                        if($brosur->brochure_qty_print_page==$key){
                                      echo '<option value="'.$key.'" selected>'.$key.'</option>';
                                      }else{
                                      echo '<option value="'.$key.'">'.$key.'</option>';

                                      }
                                      }
                                      ?>
                                    </select>
                                  </div>
                                  </div>
                                  <br>
                                  
                                  <div class="row">
                                  <div class="col-lg-5">
                                  <label>Kertas</label>
                                  </div>
                                  <div class="col-lg-4">
                                     <select  class="form-control" name="brochure_papertype_id" style="width:200px;height:30px" >
                                      <?php
                                        $papers = DB::table('ref_papertype')
                                                      ->where('papertype_type','=','envelope')
                                                      ->get();
                                      foreach($papers as $paper){
                                       if($brosur->brochure_papertype_id==$paper->papertype_id){
                                      echo '<option value="'.$paper->papertype_id.'" selected>'.$paper->papertype_name.'</option>';
                                      }else{
                                      echo '<option value="'.$paper->papertype_id.'">'.$paper->papertype_name.'</option>';

                                      }
                                      }
                                     ?>
                                    </select>
                                  </div>
                                  </div>
                                  <br>

                                  <div class="row">
                                  <div class="col-lg-5">
                                  <label>Harga <font color="red"> *</font></label>
                                  </div>
                                  <div class="col-lg-7">
                                    <input type="text"  class="form-control"  name="brochure_price" value="{{$brosur->brochure_price}}" placeholder="Harga"style="width:200px;height:30px" value="" required /></input>
                                  </div>
                                  </div>
                                  <br>

                                    <div class="row">
                                    <div class="col-lg-5">
                                      <label>Qty / Unit <font color="red"> *</font></label>
                                    </div>
                                    <div class="col-lg-3">
                                     <input type="text"  class="form-control"  name="brochure_qty_price"  value="{{$brosur->brochure_qty_price}}" placeholder="1000" style="width:90px;height:30px" value="" required/></input>
                                    </div>
                                    <div class="col-lg-1">
                                     /
                                    </div>
                                    
                                    <div class="col-lg-3">
                                      <select  class="form-control"  name="brochure_unit" style="width:80px;height:30px">
                                        <?php
                                        $brosursizes = array('Pcs','Rim');
                                      foreach($brosursizes as $key){
                                        if($brosur->brochure_unit==$key){
                                      echo '<option value="'.$key.'" selected>'.$key.'</option>';
                                      }else{
                                      echo '<option value="'.$key.'">'.$key.'</option>';

                                      }
                                      }
                                      ?>
                                      </select>
                                    </div>
                                    </div>
                                    <br>
                                      <font color="red" class="text-left">* Data tidak boleh kosong</font>
                          </div>
                          </div>
                       </div>
                    <div class="modal-footer">
                    <button type="submit" class="btn btn-sm btn-dark"><span class="fa fa-floppy-o"></span> Simpan</button>{{Form::close()}} <button class="btn btn-sm btn-dark" style="margin-right:5px" class="close" data-dismiss="modal"><span class="fa fa-times"></span> Batal</button></a>
                    </div>
                  </div>
                </div>
              </div>
              @endforeach

</div>
@stop
@stop